package com.sgb.kjwl.view.ui.adapter.self.publish;

import android.content.Context;
import android.graphics.Typeface;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.business.StorageManEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class StorageAdapter extends BaseRecycleAdapter<StorageManEntity> {

    private TextView skill_tv;


    public StorageAdapter(Context context, List<StorageManEntity> datas) {
        super(context, R.layout.item_storage, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final StorageManEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        skill_tv = holder.getItem().findViewById(R.id.skill_tv);
        skill_tv.setText(entity.getStorageName());
        if (holder.getItem().isSelected()) {
            skill_tv.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
        } else {
            skill_tv.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
        }
    }

}
